import request from '@/request';
import BusinessConstant from '@/constant/BusinessConstant';
import { CommentEntity } from '@/entities/CommentEntity';

const PREFIX = BusinessConstant.ROOT_SERVER + '/comment';

export default class HouseCommentApi {
  static addComment(data: CommentEntity.IAddComment) {
    return request({
      method: 'POST',
      url: PREFIX,
      data
    });
  }

  static getCommentByTenantId(tenantId: number) {
    return request({
      method: 'GET',
      url: `${ PREFIX }/tenantId?tenantId=${ tenantId }`
    });
  }

  static getCommentByHouseId(houseId: number) {
    return request({
      method: 'GET',
      url: `${ PREFIX }/houseId?houseId=${ houseId }`
    });
  }
}